package com.ericsson.enap.modules.topology.entity;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Objects;

@Setter
@Getter
public class CabEdge {
    private Integer labId;
    private Long sourceId;
    private String sourcePort;
    private Long targetId;
    private String targetPort;
    private int edgeType;
    private List<Integer> vlan;
    private String originalVlan;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CabEdge cabEdge = (CabEdge) o;
        return Objects.equals(labId, cabEdge.labId) &&
                Objects.equals(sourceId, cabEdge.sourceId) &&
                sourcePort.equalsIgnoreCase(cabEdge.sourcePort) &&
                Objects.equals(targetId, cabEdge.targetId) &&
                targetPort.equalsIgnoreCase(cabEdge.targetPort);
    }

    @Override
    public int hashCode() {
        return Objects.hash(labId, sourceId, sourcePort, targetId, targetPort);
    }
}
